<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cursor Restore - 面板预览</title>
    <style>
        :root {
            --vscode-editor-background: #1e1e1e;
            --vscode-editor-foreground: #d4d4d4;
            --vscode-input-background: #3c3c3c;
            --vscode-input-foreground: #cccccc;
            --vscode-input-border: #3c3c3c;
            --vscode-input-placeholderForeground: #767676;
            --vscode-focusBorder: #007fd4;
            --vscode-panel-border: #3c3c3c;
            --vscode-descriptionForeground: #9d9d9d;
            --vscode-testing-iconPassed: #73c991;
            --vscode-testing-iconFailed: #f48771;
            --vscode-testing-iconQueued: #cca700;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            padding: 20px;
            background: var(--vscode-editor-background);
            color: var(--vscode-editor-foreground);
        }

        .container {
            max-width: 600px;
            margin: 0 auto;
        }

        .header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid var(--vscode-panel-border);
        }

        .header h1 {
            font-size: 28px;
            font-weight: 600;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .header p {
            color: var(--vscode-descriptionForeground);
            font-size: 14px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            font-size: 14px;
            color: var(--vscode-input-foreground);
        }

        .form-group label .icon {
            margin-right: 6px;
        }

        .input-wrapper {
            position: relative;
        }

        .form-group input {
            width: 100%;
            padding: 12px 16px;
            background: var(--vscode-input-background);
            color: var(--vscode-input-foreground);
            border: 1px solid var(--vscode-input-border);
            border-radius: 6px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--vscode-focusBorder);
            box-shadow: 0 0 0 3px var(--vscode-focusBorder)33;
        }

        .form-group input::placeholder {
            color: var(--vscode-input-placeholderForeground);
        }

        .button-group {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-top: 30px;
        }

        .btn {
            padding: 14px 24px;
            border: none;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .btn-secondary {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .status {
            margin-top: 20px;
            padding: 12px 16px;
            border-radius: 6px;
            font-size: 13px;
            display: none;
        }

        .status.success {
            background: var(--vscode-testing-iconPassed)22;
            color: var(--vscode-testing-iconPassed);
            border-left: 4px solid var(--vscode-testing-iconPassed);
        }

        .status.error {
            background: var(--vscode-testing-iconFailed)22;
            color: var(--vscode-testing-iconFailed);
            border-left: 4px solid var(--vscode-testing-iconFailed);
        }

        .status.info {
            background: var(--vscode-testing-iconQueued)22;
            color: var(--vscode-testing-iconQueued);
            border-left: 4px solid var(--vscode-testing-iconQueued);
        }

        .footer {
            margin-top: 40px;
            text-align: center;
            color: var(--vscode-descriptionForeground);
            font-size: 12px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .spinning {
            animation: spin 1s linear infinite;
        }

        /* 亮色主题 */
        @media (prefers-color-scheme: light) {
            :root {
                --vscode-editor-background: #ffffff;
                --vscode-editor-foreground: #333333;
                --vscode-input-background: #ffffff;
                --vscode-input-foreground: #333333;
                --vscode-input-border: #cecece;
                --vscode-input-placeholderForeground: #767676;
                --vscode-focusBorder: #007acc;
                --vscode-panel-border: #e5e5e5;
                --vscode-descriptionForeground: #717171;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🔄 Cursor Restore</h1>
            <p>轻松管理您的 Cursor 激活和续杯</p>
        </div>

        <form id="configForm">
            <div class="form-group">
                <label for="cardInput">
                    <span class="icon">🔑</span>
                    激活码 (Card)
                </label>
                <div class="input-wrapper">
                    <input
                        type="text"
                        id="cardInput"
                        placeholder="请输入您的激活码"
                        autocomplete="off"
                    />
                </div>
            </div>

            <div class="form-group">
                <label for="tokenInput">
                    <span class="icon">🔐</span>
                    Token
                </label>
                <div class="input-wrapper">
                    <input
                        type="password"
                        id="tokenInput"
                        placeholder="请输入您的 Token"
                        autocomplete="off"
                    />
                </div>
            </div>

            <div class="button-group">
                <button type="button" class="btn btn-primary" id="privilegeBtn">
                    <span>⭐</span>
                    <span>一键特权</span>
                </button>
                <button type="button" class="btn btn-secondary" id="renewalBtn">
                    <span>🔄</span>
                    <span>一键续杯</span>
                </button>
            </div>
        </form>

        <div id="status" class="status"></div>

        <div class="footer">
            <p>配置自动保存 • 数据存储在本地</p>
            <p style="margin-top: 10px; font-size: 11px; opacity: 0.7;">这是面板预览，实际功能请在 VS Code 扩展中使用</p>
        </div>
    </div>

    <script>
        const cardInput = document.getElementById('cardInput');
        const tokenInput = document.getElementById('tokenInput');
        const privilegeBtn = document.getElementById('privilegeBtn');
        const renewalBtn = document.getElementById('renewalBtn');
        const statusDiv = document.getElementById('status');

        // 显示状态消息
        function showStatus(message, type = 'info') {
            statusDiv.textContent = message;
            statusDiv.className = 'status ' + type;
            statusDiv.style.display = 'block';

            setTimeout(() => {
                statusDiv.style.display = 'none';
            }, 5000);
        }

        // 保存激活码（演示）
        cardInput.addEventListener('blur', () => {
            const value = cardInput.value.trim();
            if (value) {
                showStatus('激活码已保存（演示模式）', 'success');
            }
        });

        // 保存 Token（演示）
        tokenInput.addEventListener('blur', () => {
            const value = tokenInput.value.trim();
            if (value) {
                showStatus('Token已保存（演示模式）', 'success');
            }
        });

        // 一键特权（演示）
        privilegeBtn.addEventListener('click', () => {
            if (!cardInput.value.trim()) {
                showStatus('请先输入激活码', 'error');
                cardInput.focus();
                return;
            }

            privilegeBtn.disabled = true;
            const icon = privilegeBtn.querySelector('span:first-child');
            icon.classList.add('spinning');

            setTimeout(() => {
                privilegeBtn.disabled = false;
                icon.classList.remove('spinning');
                showStatus('一键特权执行成功（演示模式）', 'success');
            }, 2000);
        });

        // 一键续杯（演示）
        renewalBtn.addEventListener('click', () => {
            if (!tokenInput.value.trim()) {
                showStatus('请先输入 Token', 'error');
                tokenInput.focus();
                return;
            }

            renewalBtn.disabled = true;
            const icon = renewalBtn.querySelector('span:first-child');
            icon.classList.add('spinning');

            setTimeout(() => {
                renewalBtn.disabled = false;
                icon.classList.remove('spinning');
                showStatus('一键续杯执行成功（演示模式）', 'success');
            }, 2000);
        });
    </script>
</body>
</html>

